﻿<catel:DataWindow x:Class="Caitlyn.Views.ConfigurationView"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				  xmlns:catel="http://catel.codeplex.com" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity">

    <!-- Resources -->
    <catel:DataWindow.Resources>
    </catel:DataWindow.Resources>

    <!-- Content -->
    <catel:StackGrid>
        <catel:StackGrid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </catel:StackGrid.RowDefinitions>

        <catel:StackGrid.ColumnDefinitions>
            <ColumnDefinition Width="500" />
        </catel:StackGrid.ColumnDefinitions>

        <Label>
            <TextBlock TextWrapping="Wrap">
                Below are the list of root projects currently available. If the configuration file did not yet exists, all NET35
                projects are automatically added to the list. <LineBreak />
                <LineBreak />
                The root projects can have rules to ignore (DoNotAdd) or to not remove (DoNotRemove) items for specific target projects.
            </TextBlock>
        </Label>

        <GroupBox Header="Root projects">
            <StackPanel>
                <ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto" MaxHeight="400">
                    <ListBox ItemsSource="{Binding RootProjects}" SelectedItem="{Binding SelectedRootProject}" Height="300">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseDoubleClick">
                                <catel:EventToCommand Command="{Binding Edit}" DisableAssociatedObjectOnCannotExecute="False" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>

                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Label Content="{Binding Name}" />
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </ScrollViewer>

                <WrapPanel>
                    <Button Command="{Binding Add}" ToolTip="Add..." Style="{StaticResource ImageButtonStyle}">
                        <Image Source="/Caitlyn;component/Resources/Images/action_add.png" Stretch="None" />
                    </Button>

                    <Button Command="{Binding Edit}" ToolTip="Edit..." Style="{StaticResource ImageButtonStyle}">
                        <Image Source="/Caitlyn;component/Resources/Images/action_edit.png" Stretch="None" />
                    </Button>

                    <Button Command="{Binding Remove}" ToolTip="Remove" Style="{StaticResource ImageButtonStyle}">
                        <Image Source="/Caitlyn;component/Resources/Images/action_remove.png" Stretch="None" />
                    </Button>
                </WrapPanel>
            </StackPanel>
        </GroupBox>
        
        <GroupBox Header="Automatic linking">
            <StackPanel>
                <CheckBox IsChecked="{Binding EnableAutoLink}" Content="Enable automatic linking" />
                <Button Command="{Binding ManageProjectMappings}" Content="Manage project mappings..." />
            </StackPanel>            
        </GroupBox>
    </catel:StackGrid>
</catel:DataWindow>
